<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>中文呈现打字效果的javacsript</title>
</head>
<body>

    <h2 id="cx"></h2>

    <script language="JavaScript" type="text/javascript">
        // 中文呈现打字效果的javacsript
        var msg = "测试成功，还需要大佬指点！";
        var interval = 300;
        var seq = 0;
        function statuShow(){
            len = msg.length;
            window.status = msg.substring(0,seq+1);
            seq++;
            if(seq>=len){
                seq = 0;
                window.status = '';
            }
            document.getElementById("cx").innerHTML = window.status
            window.setTimeout("statuShow();",interval);
        }
        statuShow();
    </script>
</body>
</html>